
public class Ball {
	private float x;
	private float y;
	private int radius;
	private float xDelta;
	private float yDelta;
	public Ball(float x, float y, int radius,int speed,int direction) {
		super();
		this.x = x;
		this.y = y;
		this.radius = radius;
		this.xDelta = (float)(speed*Math.cos(direction));
		this.yDelta = (float)(-speed*Math.sin(direction));
//		System.out.println(direction);System.out.println(Math.sin(direction));
		
	}
	public float getX() {
		return x;
	}
	public void setX(float x) {
		this.x = x;
	}
	public float getY() {
		return y;
	}
	public void setY(float y) {
		this.y = y;
	}
	public int getRadius() {
		return radius;
	}
	public float getxDelta() {
		return xDelta;
	}
	public void setxDelta(float xDelta) {
		this.xDelta = xDelta;
	}
	public float getyDelta() {
		return yDelta;
	}
	public void setyDelta(float yDelta) {
		this.yDelta = yDelta;
	}
	public void move(){
		x=x+xDelta;
		y=y+yDelta;
	}
	public void reflectHorizontal(){
		xDelta=-xDelta;
	}
	public void reflectVertical(){
		yDelta=-yDelta;
	}
	public String toString(){
		return "ball:("+x+","+y+"),speed:("+xDelta+","+yDelta+")";
	}
	
}
